import React, { Component } from 'react'

export default class App extends Component {
  state = {
    firstName: '',
    lastName: ''
  }
  render() {
    return (
      <div>
        <input onChange = { (e) => {
          console.log(e.target.value)
          this.setState({ firstName: e.target.value })
        }} value = { this.state.firstName } type="text" placeholder ="姓"/>
        + 
        <input onChange = { (e) => {
          console.log(e.target.value)
          this.setState({ lastName: e.target.value })
        }} value = { this.state.lastName } type="text" placeholder="名"/>
        = { this.state.firstName + this.state.lastName }

      </div>
    )
  }
}
